#include <stdio.h>
#include <avr/io.h>



void initSPIport(void)
{
	
    DDRB&=(0<<PB2)&(0<<PB3)&(0<<PB4)&(0<<PB5);
	PORTB|=(1<<PB4);		// MISO internal pull up
	SPCR|=(1<<SPE);
	

}



void zapis_SPI(unsigned char byte)
{
		
SPDR = byte;					//Load byte to Data register
while(!(SPSR & (1<<SPIF))); 	// Wait for transmission complete 

}

/* Vypis "stringu" */
void zapisSPI (char *text2) 
{ 
  while (*text2) 
  		zapis_SPI(*(text2++)); 
}
